package com.example;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * @author Create By Liuqz
 * @date 2018/11/14 10:49
 */
public class LambdaExpression {


    public static void main(String[] args) {

        Comparator<Apple> byColor = new Comparator<Apple>() {
            @Override
            public int compare(Apple o1,Apple o2) {
                return o1.getColor().compareTo(o2.getColor());
            }
        };
        List<Apple> list = Collections.emptyList();

        list.sort(byColor);

        Comparator<Apple> byColor2 = (o1, o2) -> o1.getColor().compareTo(o2.getColor());
    }



}
